package J4_13;

import java.util.*;

public class test {
    static Queue<Integer> queue = new ArrayDeque<>();
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        int Q = in.nextInt();
        Map<Integer, Set<Integer>> map = new HashMap<>();
        while (m-- > 0) {
            int x = in.nextInt(), y = in.nextInt();
            Set<Integer> set1 = map.getOrDefault(x,new HashSet<>());
            Set<Integer> set2 = map.getOrDefault(y,new HashSet<>());
            set1.add(y);
            set2.add(x);
            map.put(x,set1);
            map.put(y,set2);
        }
        boolean[] vis = new boolean[n+1];
        double[] ret = new double[n];
        for (int i = 0; i < Q; i++) {
            int x = in.nextInt(), y = in.nextInt();
            double count = 0;
            vis[x] = true;
            queue.add(x);
            count = bfs(map,vis,y,queue);
            ret[i] = count;
            if (ret[i]==0)ret[i] = 1;
        }
        double sum = 0;
        for (int i = 0; i < Q; i++) {
            sum += ret[i];
        }
        System.out.println(sum/Q);
    }

    private static double bfs(Map<Integer, Set<Integer>> map, boolean[] vis, int y, Queue<Integer> queue) {
        if (y == 0) return 0;
        int n = queue.size();
        int count = 0;
        for (int i = 0; i < n; i++) {
            int x = queue.poll();
            for (int k : map.get(x)) {
                if (!vis[k]) {
                    queue.add(k);
                    vis[k] = true;
                    count++;
                }
            }
        }
        return count + bfs(map,vis,y-1,queue);
    }


}
